package 补充.日期操作;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class DateDormat类 {
    public static void main(String[] args) {
        DateFormat df = SimpleDateFormat.getDateInstance();
        DateFormat df1 = SimpleDateFormat.getTimeInstance();
        DateFormat df2 = SimpleDateFormat.getDateInstance(DateFormat.YEAR_FIELD,new Locale("zh","CN"));
        DateFormat df3 = SimpleDateFormat.getTimeInstance(DateFormat.YEAR_FIELD,new Locale("zh","CN"));
        System.out.println(df.format(new Date()));
        System.out.println(df1.format(new Date()));
        System.out.println(df2.format(new Date()));
        System.out.println(df3.format(new Date()));
    }
}
